﻿namespace Grow.Module.Service
{
    /// <summary>
    /// 服务寄存对象
    /// </summary>
    public interface IServiceManager
    {
        /// <summary>
        /// 获取服务
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <returns></returns>
        TService? GetService<TService>() where TService : notnull;
        /// <summary>
        /// 获取服务
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <returns></returns>
        TService GetRequiredService<TService>() where TService : notnull;
        /// <summary>
        /// 添加服务
        /// </summary>
        /// <typeparam name="TService"></typeparam>
        /// <param name="service"></param>
        void AddService<TService>(TService service) where TService : notnull;
    }
}
